package com.dk.controller;

import com.dk.pojo.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("testController")
public class TestController {

    @RequestMapping("test")
    public String test(){
        return "list";
    }

    @RequestMapping("AddInfo")
    public String add(){
        //获取登录成功人的实体类，类似于session域对象
        User user = (User)SecurityUtils.getSubject().getPrincipal();
        System.out.println(user.getUname());
        return "add";
    }
    @RequestMapping("deleteInfo")
    public String deleteInfo(){
        return "del";
    }
    @RequestMapping("UpdateInfo")
    public String UpdateInfo(){
        return "update";
    }
    @RequestMapping("SelectInfo")
    public String SelectInfo(){
        return "sele";
    }

    @RequestMapping("unauthorized")
    public String unauthorized(){
        return "unauthorized";
    }
}
